/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.cvut.fel.taskpro.data.imanager;

import cz.cvut.fel.taskpro.data.entity.GroupTaskPro;
import cz.cvut.fel.taskpro.data.entity.Kantor;
import cz.cvut.fel.taskpro.data.entity.Student;
import cz.cvut.fel.taskpro.data.entity.Subject;
import java.util.List;
import javax.ejb.Local;

/**
 * This local interface specify database responsible action of data manager,
 * which is responsible for working with groups.
 *
 * @author Tom
 * @version 1.0.0. beta
 */
@Local
public interface IGroupData {
    /**
     * This method add group in parameter to database.
     * @param groupToAdd group to add to DB 
     */
     public void addGroup(GroupTaskPro groupToAdd);
     /**
      * This method find groups by subjects in parameter and kantor in parameter.
      * Groups are in one of subject in parameter.
      * @param loggedKantor  kantor who teach group.
      * @param subjects subjects which are group part of.
      * @return <code>List</code> of all groups which satisfy criteria in parameters. Order by 
      * subject code. If no result is found then empty list is returned
      */
     public List<GroupTaskPro> findGroupBySubjecst(List<Subject> subjects,Kantor loggedKantor);
    /**
      * This method find groups by subject in parameter and kantor in parameter.
      * @param kantor  kantor who teach group.
      * @param subject  subject which are group part of.
      * @return <code>List</code> of all groups which satisfy criteria in parameters. Order by 
      * subject code ascendent. If no result is found then empty list is returned
      */
     public List<GroupTaskPro> findGroupBySubject(Subject subject,Kantor kantor);
     /**
      * This method find group in database which has specific code and belongs to 
      * subject in parameter.
      * @param code code of group
      * @param subject subject in which are group part of
      * @return <code>List</code> of all groups which has specific code and belongs to subject in 
      * parameter. Order by group code ascendent. If no result is found then empty list is returned
      */
     public List<GroupTaskPro> getGroupBySubjectAndCode(Subject subject,String code);
        /**
      * This method find group in database which belongs to subject in parameter.
      * @param subject subject in which are group part of
      * @return <code>List</code> of all groups which  belongs to subject in 
      * parameter. Order by group code ascendent. If no result is found then empty list is returned.
      */
     public List<GroupTaskPro> getGroupsBySubject(Subject subject);
     /**
      * This method find in database group which belongs to subject in parameter
      * and in which is registred student in parameter. Only one can be in one group in subject.
      * TO DO  - check if added group expired.
      * @param student student who is member of group.
      * @param subject subject which is group part of.
      * @return group which belongs to subject in parameter
      * and in which is registred student in parameter. Order ascendent by code.
      * If no result is found then return null.
      */
     public GroupTaskPro getGroupBySubjectAndStudent(Subject subject,Student student);
     /**
      * This method update group in database based on parameter.
      * @param groupToUpdate group to update in DB
      */
     public void updateGroup(GroupTaskPro groupToUpdate);
     /**
      * This mtehod remove group from database based on parameter
      * @param groupToRemove group to remove from DB.
      */
     public void removeGroup(GroupTaskPro groupToRemove);
}
